package com.jd.dao;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.jd.po.UserGroup;



public class CreateBatFilesDAOImpl  extends HibernateDaoSupport implements CreateBatFilesDAO {

	@Override
	public String querySvnUrlByUserGroup(String userGroup, String tOrb) {
		List list = this.getHibernateTemplate().find("select usergroup from UserGroup usergroup where usergroup.gname = '" + userGroup + "'");
		UserGroup g;
		if(list.size() == 0) {
			return null;
		} else {
			g = (UserGroup)list.get(0);
		}
		if(tOrb.toLowerCase().equals("t")){
			return g.getTrunk();
		}else {
			return g.getBranch();
		}
		
	}
}
